package org.liuqm.factory.abstractfactory.sevice.impl;

import org.liuqm.factory.abstractfactory.dao.UserDao;
import org.liuqm.factory.abstractfactory.sevice.UserDaoFactory;
import org.liuqm.factory.abstractfactory.sevice.UserService;

public class UserServiceImpl implements UserService {

    private UserDaoFactory userDaoFactory = null;

    public UserDaoFactory getUserDaoFactory() {
        return userDaoFactory;
    }

    public void setUserDaoFactory(UserDaoFactory userDaoFactory) {
        this.userDaoFactory = userDaoFactory;
        userDao = userDaoFactory.createUserDao();
    }

    UserDao userDao = null;

    /**
     * 保存用户的方法
     * @param userName
     * @param password
     * @return
     */
    @Override
    public int insertUser(String userName, String password) {
        userDao.insertUser(userName,password);
        return 0;
    }
}
